# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SecurityCenter.V1.Model.Cve do
  @moduledoc """
  CVE stands for Common Vulnerabilities and Exposures. Information from the [CVE record](https://www.cve.org/ResourcesSupport/Glossary) that describes this vulnerability.

  ## Attributes

  *   `cvssv3` (*type:* `GoogleApi.SecurityCenter.V1.Model.Cvssv3.t`, *default:* `nil`) - Describe Common Vulnerability Scoring System specified at https://www.first.org/cvss/v3.1/specification-document
  *   `exploitReleaseDate` (*type:* `DateTime.t`, *default:* `nil`) - Date the first publicly available exploit or PoC was released.
  *   `exploitationActivity` (*type:* `String.t`, *default:* `nil`) - The exploitation activity of the vulnerability in the wild.
  *   `firstExploitationDate` (*type:* `DateTime.t`, *default:* `nil`) - Date of the earliest known exploitation.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The unique identifier for the vulnerability. e.g. CVE-2021-34527
  *   `impact` (*type:* `String.t`, *default:* `nil`) - The potential impact of the vulnerability if it was to be exploited.
  *   `observedInTheWild` (*type:* `boolean()`, *default:* `nil`) - Whether or not the vulnerability has been observed in the wild.
  *   `references` (*type:* `list(GoogleApi.SecurityCenter.V1.Model.Reference.t)`, *default:* `nil`) - Additional information about the CVE. e.g. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34527
  *   `upstreamFixAvailable` (*type:* `boolean()`, *default:* `nil`) - Whether upstream fix is available for the CVE.
  *   `zeroDay` (*type:* `boolean()`, *default:* `nil`) - Whether or not the vulnerability was zero day when the finding was published.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cvssv3 => GoogleApi.SecurityCenter.V1.Model.Cvssv3.t() | nil,
          :exploitReleaseDate => DateTime.t() | nil,
          :exploitationActivity => String.t() | nil,
          :firstExploitationDate => DateTime.t() | nil,
          :id => String.t() | nil,
          :impact => String.t() | nil,
          :observedInTheWild => boolean() | nil,
          :references => list(GoogleApi.SecurityCenter.V1.Model.Reference.t()) | nil,
          :upstreamFixAvailable => boolean() | nil,
          :zeroDay => boolean() | nil
        }

  field(:cvssv3, as: GoogleApi.SecurityCenter.V1.Model.Cvssv3)
  field(:exploitReleaseDate, as: DateTime)
  field(:exploitationActivity)
  field(:firstExploitationDate, as: DateTime)
  field(:id)
  field(:impact)
  field(:observedInTheWild)
  field(:references, as: GoogleApi.SecurityCenter.V1.Model.Reference, type: :list)
  field(:upstreamFixAvailable)
  field(:zeroDay)
end

defimpl Poison.Decoder, for: GoogleApi.SecurityCenter.V1.Model.Cve do
  def decode(value, options) do
    GoogleApi.SecurityCenter.V1.Model.Cve.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SecurityCenter.V1.Model.Cve do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
